home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / protocol / standard / scsi / scsi1_do.5 < prev    next >
Internet Message Format  |  1993-07-14  |  70KB

  1. From coffin@ROCKY2.ROCKEFELLER.EDU Thu Mar 22 08:33:14 1990
  2. Flags: 000000000001
  3. Return-Path: <coffin@ROCKY2.ROCKEFELLER.EDU>
  4. Received: from ROCKY2.ROCKEFELLER.EDU by rascal.ics.utexas.edu. (4.0/SMI-4.0)
  5.     id AA28499; Thu, 22 Mar 90 08:33:01 CST
  6. Received: by ROCKY2.ROCKEFELLER.EDU (5.61/1.34)
  7.     id AA15033; Thu, 22 Mar 90 09:32:24 -0500
  8. Message-Id: <9003221432.AA15033@ROCKY2.ROCKEFELLER.EDU>
  9. To: werner@rascal.ics.utexas.edu
  10. Subject: scsiDocs Part5 of 7
  11. Date: Thu, 22 Mar 90 09:32:05 -0500
  12. From: coffin@ROCKY2.ROCKEFELLER.EDU
  13.  
  14.  
  15.  
  16. .fo Section 9                            #
  17. 9. Group 0 Command Descriptions for Sequential-Access Devices
  18.  
  19. The Group 0 commands for sequential-access devices shall be as shown in 
  20. Table9-1.
  21.  
  22.                                   Table 9-1
  23.                 Group 0 Commands for Sequential-Access Devices
  24.  
  25. ==============================================================================
  26. Operation
  27.   Code      Type   Command Name                       Section
  28. ------------------------------------------------------------------------------
  29.    00H       O     TEST UNIT READY                    7.1.1 
  30.    01H       M     REWIND                             9.1
  31.    02H       V
  32.    03H       M     REQUEST SENSE                      7.1.2
  33.    04H       R
  34.    05H       E     READ BLOCK LIMITS                  9.2
  35.    06H       V
  36.    07H       V
  37.    08H       M     READ                               9.3
  38.    09H       V
  39.    0AH       M     WRITE                              9.4
  40.    0BH       O     TRACK SELECT                       9.5
  41.    0CH       V
  42.    0DH       V
  43.    0EH       V
  44.    0FH       O     READ REVERSE                       9.6
  45.    10H       M     WRITE FILEMARKS                    9.7
  46.    11H       O     SPACE                              9.8
  47.    12H       E     INQUIRY                            7.1.3
  48.    13H       O     VERIFY                             9.9
  49.    14H       O     RECOVER BUFFERED DATA              9.10
  50.    15H       O     MODE SELECT                        9.11
  51.    16H       O     RESERVE UNIT                       9.12.1
  52.    17H       O     RELEASE UNIT                       9.12.2
  53.    18H       O     COPY                               7.1.4
  54.    19H       O     ERASE                              9.13
  55.    1AH       O     MODE SENSE                         9.14
  56.    1BH       O     LOAD/UNLOAD                        9.15
  57.    1CH       O     RECEIVE DIAGNOSTIC RESULTS         7.1.5
  58.    1DH       O     SEND DIAGNOSTIC                    7.1.6
  59.    1EH       O     PREVENT/ALLOW MEDIUM REMOVAL       9.16
  60.    1FH       R
  61. ==============================================================================
  62.  
  63. Key: M  =  Command implementation is mandatory.
  64.      E  =  Command implementation is required for SCSI devices that support 
  65.            device-independent self-configuring software.
  66.      O  =  Command implementation is optional.
  67.      R  =  Operation code is reserved for future standardization.
  68.      V  =  Operation code is available for vendor unique commands.
  69. .pa
  70.  
  71. 9.1 REWIND Command
  72.  
  73.      Peripheral Device Type:  Sequential Access
  74.         Operation Code Type:  Mandatory
  75.              Operation Code:  01H
  76.  
  77.                                   Table 9-2
  78.                                 REWIND Command
  79.  
  80. ==============================================================================
  81.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  82. Byte |        |        |        |        |        |        |        |        |
  83. ==============================================================================
  84.  0   |                           Operation Code                              |
  85. -----|-----------------------------------------------------------------------|
  86.  1   | Logical Unit Number      |                  Reserved         | Immed  |
  87. -----|-----------------------------------------------------------------------|
  88.  2   |                           Reserved                                    |
  89. -----|-----------------------------------------------------------------------|
  90.  3   |                           Reserved                                    |
  91. -----|-----------------------------------------------------------------------|
  92.  4   |                           Reserved                                    |
  93. -----|-----------------------------------------------------------------------|
  94.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  95. ==============================================================================
  96.  
  97.   The REWIND command (Table 9-2) requests that the target rewind the logical 
  98. unit to the beginning-of-medium or load-point.
  99.  
  100.   An immediate (Immed) bit of one indicates that status shall be returned as 
  101. soon as the operation is initiated.  An Immed bit of zero indicates that 
  102. status shall be returned after the operation is completed.
  103. .pa
  104.  
  105. 9.2 READ BLOCK LIMITS Command
  106.  
  107.      Peripheral Device Type:  Sequential Access
  108.         Operation Code Type:  Extended
  109.              Operation Code:  05H
  110.  
  111.                                   Table 9-3
  112.                           READ BLOCK LIMITS Command
  113.  
  114. ==============================================================================
  115.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  116. Byte |        |        |        |        |        |        |        |        |
  117. ==============================================================================
  118.  0   |                           Operation Code                              |
  119. -----|-----------------------------------------------------------------------|
  120.  1   | Logical Unit Number      |                  Reserved                  |
  121. -----|-----------------------------------------------------------------------|
  122.  2   |                           Reserved                                    |
  123. -----|-----------------------------------------------------------------------|
  124.  3   |                           Reserved                                    |
  125. -----|-----------------------------------------------------------------------|
  126.  4   |                           Reserved                                    |
  127. -----|-----------------------------------------------------------------------|
  128.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  129. ==============================================================================
  130.  
  131.   The READ BLOCK LIMITS command (Table 9-3) requests that the target's 
  132. capability for block length limits be returned for the logical unit.  The READ 
  133. BLOCK LIMITS data shown in Table 9-4 shall be sent during the DATA IN phase of 
  134. the command.
  135.  
  136.                                   Table 9-4
  137.                             READ BLOCK LIMITS Data
  138.  
  139. ==============================================================================
  140. Byte |                        Description                                    |
  141. ==============================================================================
  142.  0   |                           Reserved                                    |
  143. -----|-----------------------------------------------------------------------|
  144.  1   |                           Maximum Block Length (MSB)                  |
  145. -----|-----------------------------------------------------------------------|
  146.  2   |                           Maximum Block Length                        |
  147. -----|-----------------------------------------------------------------------|
  148.  3   |                           Maximum Block Length (LSB)                  |
  149. -----|-----------------------------------------------------------------------|
  150.  4   |                           Minimum Block Length (MSB)                  |
  151. -----|-----------------------------------------------------------------------|
  152.  5   |                           Minimum Block Length (LSB)                  |
  153. ==============================================================================
  154.  
  155.   If the maximum block length equals the minimum block length, only fixed-
  156. length blocks of the length indicated are supported.  Otherwise, variable-
  157. length blocks are supported.  For variable-length blocks, if the maximum block 
  158. length equals zero, no upper limit is specified.
  159. .pa
  160.  
  161. 9.3 READ Command
  162.  
  163.      Peripheral Device Type:  Sequential Access
  164.         Operation Code Type:  Mandatory
  165.              Operation Code:  08H
  166.  
  167.                                   Table 9-5
  168.                                  READ Command
  169.  
  170. ==============================================================================
  171.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  172. Byte |        |        |        |        |        |        |        |        |
  173. ==============================================================================
  174.  0   |                           Operation Code                              |
  175. -----|-----------------------------------------------------------------------|
  176.  1   | Logical Unit Number      |                  Reserved         | Fixed  |
  177. -----|-----------------------------------------------------------------------|
  178.  2   |                           Transfer Length (MSB)                       |
  179. -----|-----------------------------------------------------------------------|
  180.  3   |                           Transfer Length                             |
  181. -----|-----------------------------------------------------------------------|
  182.  4   |                           Transfer Length (LSB)                       |
  183. -----|-----------------------------------------------------------------------|
  184.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  185. ==============================================================================
  186.  
  187.   The READ command (Table 9-5) transfers one or more block(s) to the initiator 
  188. beginning with the next block on the logical unit.  The fixed bit specifies 
  189. both the meaning of the transfer length field and whether fixed-length or 
  190. variable-length block(s) are to be transferred.
  191.  
  192.   If the fixed bit is zero, a single block shall be transferred with the 
  193. transfer length specifying the maximum number of bytes the initiator has 
  194. allocated for the returned data.  If the actual block length is different from 
  195. the specified transfer length, a CHECK CONDITION status shall be sent to the 
  196. initiator and the incorrect length indicator (ILI) bit and valid bit in 
  197. extended sense shall be set to one.  The information bytes in extended sense 
  198. shall be set to the difference (residue) between the requested transfer length 
  199. and the actual block length.  Targets that do not support negative residues 
  200. shall set the ILI bit to one and the residue to zero when the actual block 
  201. length is larger than the transfer length.  In any case, no more than transfer 
  202. length bytes shall be transferred to the initiator and the medium shall be 
  203. positioned after the block (end-of-medium side).
  204.  
  205.   If the fixed bit is one, the transfer length specifies the number of blocks 
  206. to be transferred to the initiator.  This form of the READ command is valid 
  207. only if the logical unit is currently operating in fixed block mode.  A 
  208. logical unit is in fixed block mode when either of the following conditions 
  209. are true:
  210.  
  211.   (1) The logical unit reports the same value for minimum block length and 
  212. maximum block length in response to the READ BLOCK LIMITS command.  In this 
  213. case, the current block length is the value returned.
  214.  
  215.   (2) The logical unit unit has been instructed to use fixed-length blocks 
  216. with the MODE SELECT command.  In this case, the current block length is the 
  217.  
  218. block length defined in the MODE SELECT command.
  219.  
  220.   Otherwise, the logical unit is in variable block mode.  The target may 
  221. implement fixed block mode, variable block mode, or both modes.  If the fixed 
  222. bit does not match the current mode, or the mode indicated by the fixed bit is 
  223. not implemented, the target shall reject the command by returning a CHECK 
  224. CONDITION status and by setting the sense key to ILLEGAL REQUEST.
  225.  
  226.   A successful READ command with the fixed bit equal to one shall transfer the 
  227. current block length times the transfer length bytes of data to the initiator.  
  228. Upon termination of the READ command, the medium shall be positioned after the 
  229. last block transferred (end-of-medium side).
  230.  
  231.   If the fixed bit is one and if a block is read that is larger or smaller 
  232. than the current block length, a CHECK CONDITION status shall be returned to 
  233. the initiator.  The ILI bit and the valid bit in extended sense shall be set 
  234. to one.  The information bytes shall be set to the difference (residue) 
  235. between the requested transfer length and the actual number of blocks read 
  236. (not including the incorrect length block).  Upon termination, the medium 
  237. shall be positioned after the incorrect length block (end-of-medium side). 
  238.  
  239.   If a logical unit reads a filemark during a READ command, it shall send a 
  240. CHECK CONDITION status to the initiator and shall set the filemark bit in 
  241. extended sense.  Upon termination, the medium shall be positioned after the 
  242. filemark (end-of-medium side).  If the fixed bit is one, the target shall set 
  243. the valid bit to one and the information bytes shall be set to the difference 
  244. (residue) between the requested transfer length and the actual number of 
  245. blocks read (not including the filemark).
  246.  
  247.   If a logical unit encounters the physical end-of-medium during a READ 
  248. command, the target shall return a CHECK CONDITION status to the initiator and 
  249. shall set the end-of-medium (EOM) bit to one in extended sense.  The sense key 
  250. shall be set to MEDIUM ERROR.  If the fixed bit is one, the target shall set 
  251. the valid bit to one and the information bytes to the difference (residue) 
  252. between the requested transfer length and the actual number of blocks 
  253. successfully read.  The medium position following this condition is not 
  254. defined. 
  255.  
  256.   When the transfer length is zero, no data shall be transferred and the 
  257. current position on the logical unit shall not be changed.  This condition 
  258. shall not be considered as an error. 
  259. .pa
  260.  
  261. 9.4 WRITE Command
  262.  
  263.      Peripheral Device Type:  Sequential Access
  264.         Operation Code Type:  Mandatory
  265.              Operation Code:  0AH
  266.  
  267.                                   Table 9-6
  268.                                 WRITE Command
  269.  
  270. ==============================================================================
  271.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  272. Byte |        |        |        |        |        |        |        |        |
  273. ==============================================================================
  274.  0   |                           Operation Code                              |
  275. -----|-----------------------------------------------------------------------|
  276.  1   | Logical Unit Number      |                  Reserved         | Fixed  |
  277. -----|-----------------------------------------------------------------------|
  278.  2   |                           Transfer Length (MSB)                       |
  279. -----|-----------------------------------------------------------------------|
  280.  3   |                           Transfer Length                             |
  281. -----|-----------------------------------------------------------------------|
  282.  4   |                           Transfer Length (LSB)                       |
  283. -----|-----------------------------------------------------------------------|
  284.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  285. ==============================================================================
  286.  
  287.   The WRITE command (Table 9-6) transfers one or more block(s) from the 
  288. initiator to the current position on the logical unit.  The fixed bit 
  289. specifies both the meaning of the transfer length field and whether fixed-
  290. length or variable-length block(s) are to be transferred.
  291.  
  292.   If the fixed bit is zero, a single block shall be transferred from the 
  293. initiator and shall be written to the logical unit beginning at the current 
  294. medium position.  The transfer length specifies the length of the block to be 
  295. written (in bytes).  The requested block length shall be within the minimum 
  296. and maximum block length range (returned by the READ BLOCK LIMITS command, 
  297. Section 9.2).  If this condition is not met, a CHECK CONDITION status  shall 
  298. be returned and the sense key shall be set to ILLEGAL REQUEST and no data 
  299. shall be written.  Upon successful termination, the medium shall be positioned 
  300. after the block written by this command (end-of-medium side).
  301.  
  302.   If the fixed bit is one, the transfer length field specifies the number of 
  303. block(s) to be transferred to the logical unit beginning at the current medium 
  304. position.  This form of the WRITE command is valid only if the logical unit is 
  305. currently operating in fixed block mode (see 9.3).  Upon termination, the 
  306. medium shall be positioned after the block(s) written by this command (end-of-
  307. medium side)
  308.  
  309.   The target may implement fixed block mode, variable block mode, or both 
  310. modes.  If the fixed bit does not match the current mode, or the mode 
  311. indicated by the fixed bit is not implemented, the target shall reject the 
  312. command by returning a CHECK CONDITION status and by setting the sense key to 
  313. ILLEGAL REQUEST.
  314.  
  315.   If the early warning end-of-medium condition is encountered while writing, 
  316. an attempt to finish writing any buffered data may be made.  The command shall 
  317.  
  318. terminate with a CHECK CONDITION status and the EOM bit in extended sense 
  319. shall be set to one.  If any data remains in the target's buffer, then the 
  320. sense key shall be set to VOLUME OVERFLOW.  If the fixed bit is one and the 
  321. logical unit is not buffered (buffered mode of the MODE SENSE command is 
  322. zero), then the valid bit in extended sense shall be set to one and the 
  323. information bytes shall be set to the difference (residue) between the 
  324. requested transfer length and the actual number of blocks written to the 
  325. medium.  If the fixed bit is one and the logical unit is buffered (buffered 
  326. mode of the MODE SENSE command is one), then the valid bit shall be set to one 
  327. and the information bytes shall be set to the total number of blocks not 
  328. written (the number of blocks not transferred from the initiator plus the 
  329. number of blocks remaining in the target's buffer).  Note that in this case it 
  330. is possible for the value in the information bytes to exceed the transfer 
  331. length.
  332.  
  333.   When the transfer length is zero, no data shall be transferred and the 
  334. current position on the logical unit shall not be changed.  This condition 
  335. shall not be considered as an error.
  336.  
  337. 9.5 TRACK SELECT Command
  338.  
  339.      Peripheral Device Type:  Sequential Access
  340.         Operation Code Type:  Optional
  341.              Operation Code:  0BH
  342.  
  343.                                   Table 9-7
  344.                              TRACK SELECT Command
  345.  
  346. ==============================================================================
  347.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  348. Byte |        |        |        |        |        |        |        |        |
  349. ==============================================================================
  350.  0   |                           Operation Code                              |
  351. -----|-----------------------------------------------------------------------|
  352.  1   | Logical Unit Number      |                  Reserved                  |
  353. -----|-----------------------------------------------------------------------|
  354.  2   |                           Reserved                                    |
  355. -----|-----------------------------------------------------------------------|
  356.  3   |                           Reserved                                    |
  357. -----|-----------------------------------------------------------------------|
  358.  4   |                           Track Value                                 |
  359. -----|-----------------------------------------------------------------------|
  360.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  361. ==============================================================================
  362.  
  363.   The TRACK SELECT command (Table 9-7) requests that the track specified in 
  364. the track value field be selected.
  365. .pa
  366.  
  367. 9.6 READ REVERSE Command
  368.  
  369.      Peripheral Device Type:  Sequential Access
  370.         Operation Code Type:  Optional
  371.              Operation Code:  0FH
  372.  
  373.                                   Table 9-8
  374.                              READ REVERSE Command
  375.  
  376. ==============================================================================
  377.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  378. Byte |        |        |        |        |        |        |        |        |
  379. ==============================================================================
  380.  0   |                           Operation Code                              |
  381. -----|-----------------------------------------------------------------------|
  382.  1   | Logical Unit Number      |                  Reserved         | Fixed  |
  383. -----|-----------------------------------------------------------------------|
  384.  2   |                           Transfer Length (MSB)                       |
  385. -----|-----------------------------------------------------------------------|
  386.  3   |                           Transfer Length                             |
  387. -----|-----------------------------------------------------------------------|
  388.  4   |                           Transfer Length (LSB)                       |
  389. -----|-----------------------------------------------------------------------|
  390.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  391. ==============================================================================
  392.  
  393.   The READ REVERSE command (Table 9-8) functions identically to the READ 
  394. command except that medium motion is in the reverse direction.  Thus, the 
  395. block(s) and bytes within the block(s) are transferred in the reverse order 
  396. and the medium position upon termination is before the last block read 
  397. (beginning-of-medium side).  This command shall terminate with a CHECK 
  398. CONDITION status and the EOM bit in extended sense shall be set to one if 
  399. beginning-of-medium or load-point is encountered.  The sense key shall be set 
  400. to NO SENSE.  If the fixed bit is one, then the valid bit shall be set to one 
  401. and the information bytes shall contain the difference (residue) of the 
  402. requested transfer length and the actual number of blocks transferred before 
  403. beginning-of-medium or load-point was encountered.
  404.  
  405.   Filemark handling is the same as in the READ command except that the medium 
  406. position upon command termination shall be before the filemark (beginning-of-
  407. medium side).
  408.  
  409.   If the transfer length is zero, no data shall be transferred and the current 
  410. position on the logical unit shall not be changed.  This condition shall not 
  411. be considered as an error.
  412.  
  413.   The target may implement fixed block mode, variable block mode, or both 
  414. modes.  If the fixed bit does not match the current mode, or the mode 
  415. indicated by the fixed bit is not implemented, the target shall reject the 
  416. command by returning a CHECK CONDITION status and by setting the sense key to 
  417. ILLEGAL REQUEST.
  418. .pa
  419.  
  420. 9.7 WRITE FILEMARKS Command
  421.  
  422.      Peripheral Device Type:  Sequential Access
  423.         Operation Code Type:  Mandatory
  424.              Operation Code:  10H
  425.  
  426.                                   Table 9-9
  427.                            WRITE FILEMARKS Command
  428.  
  429. ==============================================================================
  430.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  431. Byte |        |        |        |        |        |        |        |        |
  432. ==============================================================================
  433.  0   |                           Operation Code                              |
  434. -----|-----------------------------------------------------------------------|
  435.  1   | Logical Unit Number      |                  Reserved                  |
  436. -----|-----------------------------------------------------------------------|
  437.  2   |                           Number of Filemarks (MSB)                   |
  438. -----|-----------------------------------------------------------------------|
  439.  3   |                           Number of Filemarks                         |
  440. -----|-----------------------------------------------------------------------|
  441.  4   |                           Number of Filemarks (LSB)                   |
  442. -----|-----------------------------------------------------------------------|
  443.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  444. ==============================================================================
  445.  
  446.   The WRITE FILEMARKS command (Table 9-9) causes the specified number of 
  447. filemarks to be written beginning at the current medium position on the 
  448. logical unit.  A zero in this field indicates that no filemarks are to be 
  449. written.
  450.  
  451.   This command is also used to force any buffered data (see buffered mode in 
  452. the MODE SENSE command, Section 9.14) to be written.  This command shall not 
  453. return a GOOD status unless all buffered data blocks and the filemarks (if 
  454. any) are correctly written on the medium.
  455.  
  456.   If the early warning end-of-medium condition is encountered while writing, 
  457. an attempt to finish writing any buffered data may be made.  The command shall 
  458. terminate with a CHECK CONDITION status and the EOM bit in extended sense 
  459. shall be set to one.  If any filemarks remain to be written, then the sense 
  460. key shall be set to VOLUME OVERFLOW.  If the logical unit is not buffered 
  461. (buffered mode of the MODE SENSE command is zero), then the valid bit in 
  462. extended sense shall be set to one and the information bytes shall be set to 
  463. the number of unwritten filemarks.  If the logical unit is buffered (buffered 
  464. mode of the MODE SENSE command is one), then the valid bit shall be set to one 
  465. and the information bytes shall be set to the total number of blocks not 
  466. written (the number of unwritten filemarks plus the number of blocks remaining 
  467. in the target's buffer).  Note that in this case it is possible for the value 
  468. in the information bytes to exceed the transfer length.
  469. .pa
  470.  
  471. 9.8 SPACE Command
  472.  
  473.      Peripheral Device Type:  Sequential Access
  474.         Operation Code Type:  Optional
  475.              Operation Code:  11H
  476.  
  477.                                   Table 9-10
  478.                                 SPACE Command
  479.  
  480. ==============================================================================
  481.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  482. Byte |        |        |        |        |        |        |        |        |
  483. ==============================================================================
  484.  0   |                           Operation Code                              |
  485. -----|-----------------------------------------------------------------------|
  486.  1   | Logical Unit Number      |         Reserved         |      Code       |
  487. -----|-----------------------------------------------------------------------|
  488.  2   |                           Count (MSB)                                 |
  489. -----|-----------------------------------------------------------------------|
  490.  3   |                           Count                                       |
  491. -----|-----------------------------------------------------------------------|
  492.  4   |                           Count (LSB)                                 |
  493. -----|-----------------------------------------------------------------------|
  494.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  495. ==============================================================================
  496.  
  497.   The SPACE command (Table 9-10) provides a variety of positioning functions 
  498. that are determined by the code and count.  Both forward (toward end-of-
  499. medium) and reverse (toward beginning-of-medium) positioning are provided, 
  500. although some SCSI devices may only support a subset of this command.  Such 
  501. SCSI devices shall return a CHECK CONDITION status and set the sense key to 
  502. ILLEGAL REQUEST in response to any attempt to invoke a function that is not 
  503. supported.
  504.  
  505.   The code is defined as follows:
  506.  
  507. DB(1)  DB(0)       Description
  508. -----  -----   --------------------
  509.   0      0     Blocks
  510.   0      1     Filemarks
  511.   1      0     Sequential Filemarks
  512.   1      1     Physical End-of-Data
  513.  
  514.   When spacing over blocks or filemarks, the count field specifies the number 
  515. of blocks or filemarks to be spaced over.  A positive value N in the count 
  516. field shall cause forward medium movement over N blocks or filemarks ending on 
  517. the end-of-medium side of the last block or filemark.  A zero value in the 
  518. count field shall cause no medium movement.  A negative value -N (2's 
  519. complement notation) in the count field shall cause reverse medium movement 
  520. over N blocks or filemarks ending on the beginning-of-medium side of the last 
  521. block or filemark.
  522.  
  523.   If a filemark is encountered while spacing over blocks, medium movement 
  524. shall be stopped.  The medium shall be positioned on the end-of-medium side of 
  525. the filemark if movement was in the forward direction and on the beginning-of-
  526. medium side of the filemark if movement was in the reverse direction.  A CHECK 
  527.  
  528. CONDITION status shall be sent to the initiator and the filemark and valid 
  529. bits in extended sense shall be set to one.  The information bytes shall be 
  530. set to the difference (residue) in the requested count and the actual number 
  531. of blocks spaced over (not including the filemark).
  532.  
  533.   If the physical end-of-medium is encountered while spacing forward over 
  534. blocks or filemarks, the target shall return a CHECK CONDITION status to the 
  535. initiator and shall set the end-of-medium (EOM) bit in extended sense to one.  
  536. The sense key shall be set to MEDIUM ERROR.  The target shall set the valid 
  537. bit to one and the information bytes to the difference (residue) between the 
  538. requested count and the actual number of blocks or filemarks spaced over.
  539.  
  540.   If beginning-of-medium or load-point is encountered while spacing over 
  541. blocks or filemarks in the reverse direction, the target shall return a CHECK 
  542. CONDITION status to the initiator and shall set the end-of-medium (EOM) bit in 
  543. extended sense to one.  The sense key shall be set to NO SENSE.  The target 
  544. shall set the valid bit to one and the information bytes to the difference 
  545. (residue) between the requested count and the actual number of blocks or 
  546. filemarks spaced over.
  547.  
  548.   When spacing over sequential filemarks, the count field is interpreted as 
  549. follows:
  550.  
  551.   (1) A positive value N shall cause forward medium movement to the first 
  552. occurrence of N or more consecutive filemarks stopping after the Nth filemark.
  553.  
  554.   (2) A zero value shall cause no medium movement.
  555.  
  556.   (3) A negative value -N (2's complement notation) shall cause reverse medium 
  557. movement to the first occurrence of N or more consecutive filemarks stopping 
  558. on the beginning-of-medium side of the Nth filemark.
  559.  
  560.   When spacing to physical end-of-data, the count field is ignored.  Forward 
  561. medium movement shall occur until the logical unit encounters physical end-of-
  562. data as defined by the sequential-access device.  Some sequential-access 
  563. devices  define physical end-of-data as an erased area on the medium; however, 
  564. other definitions are not precluded.  Targets that implement this function 
  565. shall leave the medium positioned such that a subsequent WRITE command would 
  566. append data to the last recorded information on the medium.
  567. .pa
  568.  
  569. 9.9 VERIFY Command
  570.  
  571.      Peripheral Device Type:  Sequential Access
  572.         Operation Code Type:  Optional
  573.              Operation Code:  13H
  574.  
  575.                                   Table 9-11
  576.                                 VERIFY Command
  577.  
  578. ==============================================================================
  579.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  580. Byte |        |        |        |        |        |        |        |        |
  581. ==============================================================================
  582.  0   |                           Operation Code                              |
  583. -----|-----------------------------------------------------------------------|
  584.  1   | Logical Unit Number      |         Reserved         | BytCmp | Fixed  |
  585. -----|-----------------------------------------------------------------------|
  586.  2   |                           Verification Length (MSB)                   | 
  587. -----|-----------------------------------------------------------------------|
  588.  3   |                           Verification Length                         |
  589. -----|-----------------------------------------------------------------------|
  590.  4   |                           Verification Length (LSB)                   | 
  591. -----|-----------------------------------------------------------------------|
  592.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  593. ==============================================================================
  594.  
  595.   The VERIFY command (Table 9-11) verifies one or more block(s) beginning with 
  596. the next block on the logical unit.  The fixed bit specifies both the meaning 
  597. of the verification length field and whether fixed-length or variable-length 
  598. block(s) are to be verified.
  599.  
  600.   A byte compare (BytCmp) bit of zero indicates that the verification shall be 
  601. simply a medium verification (CRC, ECC, etc).  No data shall be transferred 
  602. between the initiator and target.  A byte compare bit of one indicates that a 
  603. byte-by-byte compare of the data on the medium, and the data transferred from 
  604. the initiator shall be performed by the target.  Data shall be transferred 
  605. >From the initiator to the target as in a WRITE command.
  606.  
  607.   A fixed bit of zero requests that the next block of the logical unit be 
  608. verified.  The verification length specifies the number of bytes to verify.  A 
  609. fixed bit of one requests verification length blocks be verified beginning 
  610. with the next logical block on the logical unit.  This form of the VERIFY 
  611. command is only valid if the logical unit is currently in fixed block mode as 
  612. defined in the READ command.  If the data does not compare (byte compare bit 
  613. equals one), the command shall terminate with a CHECK CONDITION status and the 
  614. sense key shall be set to MISCOMPARE.  If the fixed bit is one, the valid bit 
  615. shall be set to one and the information bytes shall be set to the difference 
  616. (residue) between the verification length and the actual number of blocks 
  617. successfully verified.  The medium shall be positioned after the block 
  618. containing the miscompare (end-of-medium side).
  619.  
  620.   The target may implement fixed block mode, variable block mode, or both 
  621. modes.  If the fixed bit does not match the current mode, or the mode 
  622. indicated by the fixed bit is not implemented, the target shall reject the 
  623. command by returning a CHECK CONDITION status and by setting the sense key to 
  624. ILLEGAL REQUEST.
  625.  
  626.  
  627.   The VERIFY command shall terminate when the verification length has been 
  628. satisfied, when a filemark is encountered, or when physical end-of-medium is 
  629. encountered.  The status and sense data for each of these conditions are 
  630. handled the same as in the READ command.  Upon completion of the VERIFY 
  631. command, the medium shall be positioned after the last block from which data 
  632. was verified or after the filemark, if encountered. 
  633.  
  634.   When the verification length is zero, no data shall be verified and the 
  635. current position on the logical unit shall not be changed.  This condition 
  636. shall not be considered as an error.
  637.  
  638. 9.10 RECOVER BUFFERED DATA Command
  639.  
  640.      Peripheral Device Type:  Sequential Access
  641.         Operation Code Type:  Optional
  642.              Operation Code:  14H
  643.  
  644.                                   Table 9-12
  645.                         RECOVER BUFFERED DATA Command
  646.  
  647. ==============================================================================
  648.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  649. Byte |        |        |        |        |        |        |        |        |
  650. ==============================================================================
  651.  0   |                           Operation Code                              |
  652. -----|-----------------------------------------------------------------------|
  653.  1   | Logical Unit Number      |                  Reserved         | Fixed  |
  654. -----|-----------------------------------------------------------------------|
  655.  2   |                           Transfer Length (MSB)                       |
  656. -----|-----------------------------------------------------------------------|
  657.  3   |                           Transfer Length                             |
  658. -----|-----------------------------------------------------------------------|
  659.  4   |                           Transfer Length (LSB)                       |
  660. -----|-----------------------------------------------------------------------|
  661.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  662. ==============================================================================
  663.  
  664.   The RECOVER BUFFERED DATA command (Table 9-12) is used to read data that has 
  665. been transferred to an SCSI device buffer but has not been written on the 
  666. medium.  It is normally only used to recover from error or exception 
  667. conditions that make it impossible to write the buffered data on the medium.
  668.  
  669.   This command functions similarly to the READ command except that the data is 
  670. transferred from the SCSI device buffer instead of the medium.  The order in 
  671. which block(s) are transferred is the same as if they would have been 
  672. transferred to the medium.  One or more RECOVER BUFFERED DATA commands may be 
  673. used to read the unwritten buffered data.
  674.  
  675.   The target may implement fixed block mode, variable block mode, or both 
  676. modes.  If the fixed bit does not match the current mode, or the mode 
  677. indicated by the fixed bit is not implemented, the target shall reject the 
  678. command by returning a CHECK CONDITION status and by setting the sense key to 
  679. ILLEGAL REQUEST.
  680.  
  681.   If an attempt is made to recover more logical blocks of data than are 
  682.  
  683. contained in the SCSI device buffer, the command shall be terminated with a 
  684. CHECK CONDITION status.  The EOM bit in extended sense shall be set to one.  
  685. If the fixed bit is one, the valid bit shall be set to one and the information 
  686. bytes shall be set to the difference (residue) between the requested transfer 
  687. length and the actual number of blocks transferred.
  688.  
  689.   The transfer length specifies the number of contiguous logical blocks of 
  690. data to be transferred.  A transfer length of zero indicates that no data 
  691. shall be transferred.  This condition shall not be considered as an error.
  692.  
  693. 9.11 MODE SELECT Command
  694.  
  695.      Peripheral Device Type:  Sequential Access
  696.         Operation Code Type:  Optional
  697.              Operation Code:  15H
  698.  
  699.                                   Table 9-13
  700.                              MODE SELECT Command
  701.  
  702. ==============================================================================
  703.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  704. Byte |        |        |        |        |        |        |        |        |
  705. ==============================================================================
  706.  0   |                           Operation Code                              |
  707. -----|-----------------------------------------------------------------------|
  708.  1   | Logical Unit Number      |                  Reserved                  |
  709. -----|-----------------------------------------------------------------------|
  710.  2   |                           Reserved                                    |
  711. -----|-----------------------------------------------------------------------|
  712.  3   |                           Reserved                                    |
  713. -----|-----------------------------------------------------------------------|
  714.  4   |                           Parameter List Length                       |
  715. -----|-----------------------------------------------------------------------|
  716.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  717. ==============================================================================
  718.  
  719.   The MODE SELECT command (Table 9-13) provides a means for the initiator to 
  720. specify medium, logical unit, or peripheral device parameters to the target.
  721.  
  722.   The  parameter list length specifies the length in bytes of the MODE SELECT 
  723. parameter list that shall be transferred during the DATA OUT phase.  A zero 
  724. parameter list length indicates that no data shall be transferred.  This 
  725. condition shall not be considered as an error.
  726.  
  727.   The MODE SELECT parameter list shown in Table 9-14 contains a four-byte 
  728. header, followed by zero or more eight-byte block descriptors, followed by the 
  729. vendor unique parameters, if any.
  730. .pa
  731.  
  732.                                   Table 9-14
  733.                           MODE SELECT Parameter List
  734.  
  735. ==============================================================================
  736.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  737. Byte |        |        |        |        |        |        |        |        |
  738. ==============================================================================
  739.  0   |                           Reserved                                    |
  740. -----|-----------------------------------------------------------------------|
  741.  1   |                           Reserved                                    |
  742. -----|-----------------------------------------------------------------------|
  743.  2   |Reserved|      Buffered Mode       |          Speed                    |
  744. -----|-----------------------------------------------------------------------|
  745.  3   |                           Block Descriptor Length                     |
  746. ============================================================================== 
  747.      |                        Block Descriptor(s)                            |
  748. ==============================================================================
  749.  0   |                           Density Code                                |
  750. -----|-----------------------------------------------------------------------|
  751.  1   |                           Number of Blocks (MSB)                      |
  752. -----|-----------------------------------------------------------------------|
  753.  2   |                           Number of Blocks                            |
  754. -----|-----------------------------------------------------------------------|
  755.  3   |                           Number of Blocks (LSB)                      |
  756. -----|-----------------------------------------------------------------------|
  757.  4   |                           Reserved                                    |
  758. -----|-----------------------------------------------------------------------|
  759.  5   |                           Block Length (MSB)                          |
  760. -----|-----------------------------------------------------------------------|
  761.  6   |                           Block Length                                |
  762. -----|-----------------------------------------------------------------------|
  763.  7   |                           Block Length (LSB)                          |
  764. ==============================================================================
  765.      |                        Vendor Unique Parameter(s)                     |
  766. ==============================================================================
  767. 0 _ n|                           Vendor Unique                               |
  768.      |                           Parameter Byte(s)                           |
  769. ==============================================================================
  770.  
  771.   A buffered mode of zero indicates that the target shall not report a GOOD 
  772. status on WRITE commands until the data blocks are actually written on the 
  773. medium.  A buffered mode of one indicates that the target may report a GOOD 
  774. status on WRITE commands as soon as the data block has been transferred to the 
  775. SCSI device buffer.  One or more blocks may be buffered prior to writing the 
  776. block(s) to the medium.  Buffered modes of 2H through 7H are reserved.
  777.  
  778.   Code values for the speed field shall be assigned as follows:
  779.  
  780.    0H         Default (Use the  peripheral device's default speed).
  781.    1H         Use the peripheral device's lowest speed.
  782.    2H _ FH    Use increasing peripheral device speeds.
  783.  
  784.   The block descriptor length specifies the length in bytes of all the block 
  785. descriptors.  It is equal to the number of block descriptors times eight and 
  786. does not include the vendor unique parameters, if any.  A block descriptor 
  787. length of zero indicates that no block descriptors are included in the 
  788.  
  789. parameter list.  This condition shall not be considered as an error.
  790.  
  791.   Each block descriptor specifies the medium characteristics for all or part 
  792. of a logical unit.  Each block descriptor contains a density code, a number of 
  793. blocks, and a block length.
  794.  
  795.   Code values for the density code field are defined in Table 9-14.1.
  796.  
  797.                                  Table 9-14.1
  798.                        Sequential-access Density Codes
  799.  
  800. ==============================================================================
  801. Code Value                             Density
  802. ----------  ------------------------------------------------------------------
  803.    00H      Default (peripheral device's default or only density)
  804.        
  805.                                     Magnetic Tapes
  806.             Width                  Density                 Reference
  807.             mm. (Inch)   Tracks  BPMM   (BPI)  Code  Type  Standard      Note
  808.             ----------   ------  ------------  ----  ----  ------------  ----
  809.    01H      12.7 (0.5)      9     32    (800)  NRZI   R    X3.22-1983      3
  810.    02H      12.7 (0.5)      9     63  (1 600)  PE     R    X3.39-1973      3
  811.    03H      12.7 (0.5)      9    246  (6 250)  GCR    R    X3.54-1976      3
  812.    04H       6.3 (0.25)    4/9   315  (8 000)  GCR    C                  2,4
  813.    05H       6.3 (0.25)    4/9   315  (8 000)  GCR    C    X3.136-198X     2
  814.    06H      12.7 (0.5)      9    126  (3 200)  PE     R    X3B5/85-98    1,3
  815.    07H       6.3 (0.25)     4    252  (6 400)  IMFM   C    X3.116-198X     2
  816.    08H      3.81 (0.15)     4    315  (8 000)  GCR    CS   X3B5/85-77    1,2
  817.    09H      12.7 (0.5)     18                         C    X3B5/85-76    1,3
  818.    0AH      12.7 (0.5)     22    267  (6 667)  MFM    C                    2
  819.    0BH       6.3 (0.25)     4     63  (1 600)  PE     C    X3.56-198X      2
  820.    0CH      12.7 (0.5)     24    500 (12 690)  GCR    C                    2
  821.    0DH      12.7 (0.5)     24    999 (25 380)  GCR    C                    2
  822.  
  823. 80H _ FFH   Vendor unique
  824. All others  Reserved
  825. ==============================================================================
  826. Key:
  827.                Code                                       Type
  828. --------------------------------------------       -----------------------
  829. NRZI  Non Return to Zero, change on ones           R   Reel-to-Reel
  830. GCR   Group Code Recording                         C   Cartridge
  831. PE    Phase Encoded                                CS  Cassette
  832. IMFM  Inverted Modified Frequency Modulation
  833.  
  834. NOTES:
  835.   (1)  Working Draft.  X3B5 assigns a new document number to each revision of 
  836. their documents.  Please contact the Chairman of X3B5 for the latest document 
  837. number.
  838.   (2)  Serially Recorded.
  839.   (3)  Parallel Recorded.
  840.   (4)  Old format known as QIC-11.
  841.  
  842.  
  843.   The number of blocks field specifies the number of logical blocks on the 
  844. medium that meet the density code and block length in the block descriptor.  A 
  845.  
  846. number of blocks of zero indicates that all of the remaining logical blocks of 
  847. the logical unit shall have the medium characteristics specified by the block 
  848. descriptor.
  849.  
  850.   The block length specifies the length in bytes of each logical block 
  851. described by the block descriptor.  A block length of zero indicates that the 
  852. length shall be variable.
  853. .fo Section 9                          132.1
  854. .pa
  855.  
  856. .fo Section 9                          132.2
  857. 9.12 RESERVE UNIT and RELEASE UNIT Commands
  858.  
  859.      Peripheral Device Type:  Sequential Access
  860.         Operation Code Type:  Optional
  861.              Operation Code:  16H and 17H, respectively
  862.  
  863.                                   Table 9-15
  864.                     RESERVE UNIT and RELEASE UNIT Commands
  865.  
  866. ==============================================================================
  867.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  868. Byte |        |        |        |        |        |        |        |        |
  869. ==============================================================================
  870.  0   |                           Operation Code                              |
  871. -----|-----------------------------------------------------------------------|
  872.  1   | Logical Unit Number      | 3rdPty | Third Party Device ID    |Reserved|
  873. -----|-----------------------------------------------------------------------|
  874.  2   |                           Reserved                                    |
  875. -----|-----------------------------------------------------------------------|
  876.  3   |                           Reserved                                    |
  877. -----|-----------------------------------------------------------------------|
  878.  4   |                           Reserved                                    |
  879. -----|-----------------------------------------------------------------------|
  880.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  881. ==============================================================================
  882.  
  883.   The RESERVE UNIT and RELEASE UNIT commands both use the command descriptor 
  884. block shown in Table 9-15.
  885.  
  886.   9.12.1 RESERVE UNIT Command.  The RESERVE UNIT command (Table 9-15, 
  887. operation code 16H) shall reserve the specified logical unit for the exclusive 
  888. use by the requesting initiator or, if third-party reservation option is 
  889. implemented, to another specified SCSI device.
  890.  
  891.   The reservation shall remain in effect until superceded by another RESERVE 
  892. UNIT command from the initiator that made the reservation or until released by 
  893. a RELEASE UNIT command from the same initiator, or a BUS DEVICE RESET message 
  894. >From any initiator, or a "hard" RESET condition.  The occurrence of the last 
  895. two conditions is indicated by a sense key of UNIT ATTENTION on the next 
  896. command following the condition.  It is not an error to issue this command to 
  897. a logical unit that is currently reserved to the requesting initiator.
  898.  
  899.   If the logical unit is previously reserved by another initiator, then the 
  900. target shall either:
  901.  
  902.   (1)  return a RESERVATION CONFLICT status
  903.  
  904.   (2)  queue the reservation request and disconnect until all previously 
  905. queued reservations have been released.  When the logical unit is available, 
  906. the target shall reconnect to perform the reservation
  907.  
  908.   If, after honoring the reservation, any other initiator then subsequently 
  909. attempts to perform any command on the reserved logical unit other than a 
  910. RESERVE UNIT command, which may be queued, or a RELEASE UNIT command, which 
  911. shall be ignored, then the command shall be rejected with a RESERVATION 
  912. CONFLICT status. 
  913.  
  914. .pn 133
  915. .fo Section 9                            #
  916.  
  917.   The third-party reservation option for the RESERVE UNIT command allows an 
  918. initiator to reserve a logical unit for another SCSI device.  This option is 
  919. intended for use in multiple-initiator systems that use the COPY command.  Any 
  920. target that implements the third-party reservation option shall also implement 
  921. the third-party release option (see 9.12.2).
  922.  
  923.   If the third-party (3rdPty) bit is zero, then the third-party reservation 
  924. option is not requested.  If the 3rdPty bit is one and the third-party 
  925. reservation option is implemented, then the RESERVE UNIT command shall reserve 
  926. the specified logical unit for the SCSI device specified in the third-party 
  927. device ID field.  The target shall preserve the reservation until superceded 
  928. by another RESERVE UNIT command from the initiator that made the reservation 
  929. or until released by the same initiator, by a BUS DEVICE RESET message from 
  930. any initiator, or by a "hard" RESET condition.  The target shall ignore (i.e., 
  931. return GOOD status) any attempt made by any other initiator to release the 
  932. reservation.
  933.  
  934.   If the 3rdPty bit is one and the third-party reservation option is not 
  935. implemented, then the target shall reject the RESERVE UNIT command with a 
  936. CHECK CONDITION status and a sense key of ILLEGAL REQUEST. 
  937.  
  938.   An initiator that holds a current reservation may modify that reservation 
  939. (e.g., switch third-parties) by issuing another RESERVE UNIT command to the 
  940. same logical unit.  The superceding RESERVE UNIT command shall release the 
  941. previous reservation state only when the new reservation is granted.  A 
  942. superceding reservation takes priority over any previously queued reservation 
  943. request.
  944.  
  945.   9.12.2 RELEASE UNIT Command.  The RELEASE UNIT command (Table 9-15, 
  946. operation code 17H) shall release the logical unit if it is currently reserved 
  947. by the requesting initiator. 
  948.  
  949.   It is not an error to attempt to release a logical unit that is not 
  950. currently reserved to the requesting initiator.  However, it shall not be 
  951. released if it is reserved by another initiator.
  952.  
  953.   The third-party release option for the RELEASE UNIT command allows an 
  954. initiator to release a logical unit that was previously reserved using the 
  955. third-party reservation option (see 9.12.1).  This option shall be implemented 
  956. if the third-party reservation option is implemented.  This option is intended 
  957. for use in multiple-initiator systems that use the COPY command.
  958.  
  959.   If the third-party (3rdPty) bit is zero, then the third-party release option 
  960. is not requested.  If the 3rdPty bit is one and the target implements the 
  961. third-party release option, then the target shall release the specified 
  962. logical unit, but only if the reservation was made using the third-party 
  963. reservation option by the initiator that is requesting the release and for the 
  964. same SCSI device as specified in the third-party device ID field.
  965.  
  966.   If the 3rdPty bit is one and the target does not implement the third-party 
  967. release option, then the target shall terminate the command with a CHECK 
  968. CONDITION status and the sense key shall be set to ILLEGAL REQUEST.
  969. .pa
  970.  
  971. 9.13 ERASE Command
  972.  
  973.      Peripheral Device Type:  Sequential Access
  974.         Operation Code Type:  Optional
  975.              Operation Code:  19H
  976.  
  977.                                   Table 9-16
  978.                                 ERASE Command
  979.  
  980. ==============================================================================
  981.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  982. Byte |        |        |        |        |        |        |        |        |
  983. ==============================================================================
  984.  0   |                           Operation Code                              |
  985. -----|-----------------------------------------------------------------------|
  986.  1   | Logical Unit Number      |                  Reserved         | Long   |
  987. -----|-----------------------------------------------------------------------|
  988.  2   |                           Reserved                                    |
  989. -----|-----------------------------------------------------------------------|
  990.  3   |                           Reserved                                    |
  991. -----|-----------------------------------------------------------------------|
  992.  4   |                           Reserved                                    |
  993. -----|-----------------------------------------------------------------------|
  994.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  995. ==============================================================================
  996.  
  997.   The ERASE command (Table 9-16) causes part or all of the remaining medium to 
  998. be erased beginning from the current medium position.  As used here, "erased" 
  999. means either the medium shall be erased or a pattern shall be written on the 
  1000. medium that appears as gap to the target.
  1001.  
  1002.   The distance to be erased is controlled by the long bit.  A long bit of one 
  1003. indicates that all remaining medium on the logical unit shall be erased.  A 
  1004. long bit of zero indicates that a peripheral device specified portion of the 
  1005. medium shall be erased.  Normally, short erases are used to create an extended 
  1006. gap for software controlled error recovery or for support of "update in place" 
  1007. functions.  The medium position following an ERASE command with a long bit of 
  1008. one is not defined by this standard.
  1009.  
  1010. NOTE:  Some targets may reject ERASE commands with the long bit set to one if 
  1011. the medium is not positioned at the beginning-of-medium.
  1012. .pa
  1013.  
  1014. 9.14 MODE SENSE Command
  1015.  
  1016.      Peripheral Device Type:  Sequential Access
  1017.         Operation Code Type:  Optional
  1018.              Operation Code:  1AH
  1019.  
  1020.                                   Table 9-17
  1021.                               MODE SENSE Command
  1022.  
  1023. ==============================================================================
  1024.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1025. Byte |        |        |        |        |        |        |        |        |
  1026. ==============================================================================
  1027.  0   |                           Operation Code                              |
  1028. -----|-----------------------------------------------------------------------|
  1029.  1   | Logical Unit Number      |                  Reserved                  |
  1030. -----|-----------------------------------------------------------------------|
  1031.  2   |                           Reserved                                    |
  1032. -----|-----------------------------------------------------------------------|
  1033.  3   |                           Reserved                                    |
  1034. -----|-----------------------------------------------------------------------|
  1035.  4   |                           Allocation Length                           |
  1036. -----|-----------------------------------------------------------------------|
  1037.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1038. ==============================================================================
  1039.  
  1040.   The MODE SENSE command (Table 9-17) provides a means for a target to report 
  1041. its medium, logical unit, or peripheral device parameters to the initiator.  
  1042. It is a complementary command to the MODE SELECT command (see 9.11) for 
  1043. support of a medium that may contain different densities, such as half-inch 
  1044. tapes.
  1045.  
  1046.   The allocation length specifies the number of bytes that the initiator has 
  1047. allocated for returned MODE SENSE data.  An allocation length of zero 
  1048. indicates that no MODE SENSE data shall be transferred.  This condition shall 
  1049. not be considered as an error.  Any other value indicates the maximum number 
  1050. of bytes that shall be transferred.  The target shall terminate the DATA IN 
  1051. phase when allocation length bytes have been transferred or when all available 
  1052. MODE SENSE data have been transferred to the initiator, whichever is less.
  1053.  
  1054.   The MODE SENSE data (Table 9-18) contains a four-byte header, followed by 
  1055. zero or more eight-byte block descriptors, followed by the vendor unique 
  1056. parameters, if any.
  1057. .pa
  1058.  
  1059.                                   Table 9-18
  1060.                                MODE SENSE Data
  1061.  
  1062. ==============================================================================
  1063.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1064. Byte |        |        |        |        |        |        |        |        |
  1065. ==============================================================================
  1066.  0   |                           Sense Data Length                           |
  1067. -----|-----------------------------------------------------------------------|
  1068.  1   |                           Medium Type                                 |
  1069. -----|-----------------------------------------------------------------------|
  1070.  2   |   WP   |   Buffered Mode          |         Speed                     |
  1071. -----|-----------------------------------------------------------------------|
  1072.  3   |                           Block Descriptor Length                     |
  1073. ==============================================================================
  1074.      |                        Block Descriptor(s)                            |
  1075. ==============================================================================
  1076.  0   |                           Density Code                                |
  1077. -----|-----------------------------------------------------------------------|
  1078.  1   |                           Number of Blocks (MSB)                      |
  1079. -----|-----------------------------------------------------------------------|
  1080.  2   |                           Number of Blocks                            |
  1081. -----|-----------------------------------------------------------------------|
  1082.  3   |                           Number of Blocks (LSB)                      |
  1083. -----|-----------------------------------------------------------------------|
  1084.  4   |                           Reserved                                    |
  1085. -----|-----------------------------------------------------------------------|
  1086.  5   |                           Block Length (MSB)                          |
  1087. -----|-----------------------------------------------------------------------|
  1088.  6   |                           Block Length                                |
  1089. -----|-----------------------------------------------------------------------|
  1090.  7   |                           Block Length (LSB)                          |
  1091. ==============================================================================
  1092.      |                        Vendor Unique Parameter(s)                     |
  1093. ==============================================================================
  1094. 0 _ n|                           Vendor Unique                               |
  1095.      |                           Parameter Byte(s)                           |
  1096. ==============================================================================
  1097.  
  1098.   The sense data length specifies the length in bytes of the following mode 
  1099. sense data that is available to be transferred during the DATA IN phase.  The 
  1100. sense data length does not include itself.
  1101.  
  1102.   Code values for the medium type field shall be assigned as follows:
  1103.  
  1104.    00H        Default (Only one medium type supported)
  1105.    01H _ 7FH  Reserved
  1106.    80H _ FFH  Vendor unique
  1107.  
  1108.   A write protected (WP) bit of zero indicates that the medium is write 
  1109. enabled.  A write protected bit of one indicates that the medium is write 
  1110. protected.
  1111.  
  1112.   A buffered mode of zero indicates that the target does not report a GOOD 
  1113. status on WRITE commands until the data blocks are actually written on the 
  1114. medium.  A buffered mode of one indicates that the target may report a GOOD 
  1115.  
  1116. status on WRITE commands as soon as the data block has been transferred to the 
  1117. SCSI device buffer.  One or more blocks may be buffered prior to writing the 
  1118. block(s) to the medium.  Buffered modes of 2H through 7H are reserved.
  1119.  
  1120.   Code values for the speed field shall be assigned as follows:
  1121.  
  1122.    0H         Default (only one speed supported)
  1123.    1H         Lowest peripheral device speed
  1124.    2H _ FH    Increasing peripheral device speeds
  1125.  
  1126.   The block descriptor length specifies the length in bytes of all the block 
  1127. descriptors.  It is equal to the number of block descriptors times eight and 
  1128. does not include the vendor unique parameters, if any.  A block descriptor 
  1129. length of zero indicates that no block descriptors shall be included in the 
  1130. parameter list.  This condition shall not be considered as an error.
  1131.  
  1132.   Each block descriptor specifies the medium characteristics for all or part 
  1133. of a logical unit.  Each block descriptor contains a density code, a number of 
  1134. blocks, and a block length.
  1135.  
  1136.   Code values for the density code field are defined in Table 9-14.1.
  1137.  
  1138.   The number of blocks field specifies the number of logical blocks on the 
  1139. medium that meet the density code and block length in the block descriptor.  A 
  1140. number of blocks of zero indicates that all of the remaining logical blocks of 
  1141. the logical unit have the medium characteristics specified by the block 
  1142. descriptor.
  1143.  
  1144.   The block length specifies the length in bytes of each logical block 
  1145. described by the block descriptor.  A block length of zero indicates that the 
  1146. length is variable.
  1147. .pa
  1148.  
  1149. 9.15 LOAD/UNLOAD Command
  1150.  
  1151.      Peripheral Device Type:  Sequential Access
  1152.         Operation Code Type:  Optional
  1153.              Operation Code:  1BH
  1154.  
  1155.                                   Table 9-19
  1156.                              LOAD/UNLOAD Command 
  1157.  
  1158. ==============================================================================
  1159.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1160. Byte |        |        |        |        |        |        |        |        |
  1161. ==============================================================================
  1162.  0   |                           Operation Code                              |
  1163. -----|-----------------------------------------------------------------------|
  1164.  1   | Logical Unit Number      |                  Reserved         | Immed  |
  1165. -----|-----------------------------------------------------------------------|
  1166.  2   |                           Reserved                                    |
  1167. -----|-----------------------------------------------------------------------|
  1168.  3   |                           Reserved                                    |
  1169. -----|-----------------------------------------------------------------------|
  1170.  4   |                           Reserved                  | Re-Ten |  Load  |
  1171. -----|-----------------------------------------------------------------------|
  1172.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1173. ==============================================================================
  1174.  
  1175.   The LOAD/UNLOAD command (Table 9-19) requests that the target enable or 
  1176. disable the logical unit for further operations.  This command may also be 
  1177. used to request the re-tension function on peripheral devices that support 
  1178. this function.
  1179.  
  1180.   A load bit of one indicates that the medium on the logical unit shall be 
  1181. loaded and positioned to the beginning-of-medium or load-point as determined 
  1182. by the peripheral device.  A load bit of zero indicates that the medium on the 
  1183. logical unit shall be positioned for removal from the peripheral device.
  1184.  
  1185.   Status shall be returned after the medium is positioned unless the immediate 
  1186. (Immed) bit is one.  If the Immed bit is one, status may be returned as soon 
  1187. as the command has been accepted.
  1188.  
  1189.   A re-tension (Re-Ten) bit of one indicates that the medium on the addressed 
  1190. logical unit shall be correctly tensioned before the LOAD/UNLOAD command is 
  1191. completed.  This is an optional function intended for use by those peripheral 
  1192. devices that support the re-tension function.
  1193. .pa
  1194.  
  1195. 9.16 PREVENT/ALLOW MEDIUM REMOVAL Command
  1196.  
  1197.      Peripheral Device Type:  Sequential Access
  1198.         Operation Code Type:  Optional
  1199.              Operation Code:  1EH
  1200.  
  1201.                                   Table 9-20
  1202.                      PREVENT/ALLOW MEDIUM REMOVAL Command
  1203.  
  1204. ==============================================================================
  1205.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1206. Byte |        |        |        |        |        |        |        |        |
  1207. ==============================================================================
  1208.  0   |                           Operation Code                              | 
  1209. -----|-----------------------------------------------------------------------|
  1210.  1   | Logical Unit Number      |                  Reserved                  |
  1211. -----|-----------------------------------------------------------------------|
  1212.  2   |                           Reserved                                    |
  1213. -----|-----------------------------------------------------------------------|
  1214.  3   |                           Reserved                                    |
  1215. -----|-----------------------------------------------------------------------|
  1216.  4   |                           Reserved                           | Prevent|
  1217. -----|-----------------------------------------------------------------------|
  1218.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1219. ==============================================================================
  1220.  
  1221.   The PREVENT/ALLOW MEDIUM REMOVAL command (Table 9-20) requests that the 
  1222. target enable or disable the removal of the medium in the logical unit.
  1223.  
  1224.   A prevent bit of one shall inhibit mechanisms that normally allow removal of 
  1225. the medium.  A prevent bit of zero shall allow removal of the medium.
  1226.  
  1227.   This prevention of medium removal condition shall terminate upon receipt of 
  1228. a PREVENT/ALLOW MEDIUM REMOVAL command with the prevent bit set to zero, or by 
  1229. the receipt of a BUS DEVICE RESET message from any initiator or by a "hard" 
  1230. RESET condition.
  1231. .pa
  1232.  
  1233. 
  1234.  
  1235.